#include "model/Component.h"
#include "model/Diagram.h"

Component::Component() {
	nombre = "componente";
	componentType = ComponentTypeNone;
	m_posX = m_posY = 0;
}

void Component::addToDiagram(Diagram* diagram) {
	diagram->addComponent(this);
}

void Component::removeFromDiagram(Diagram* diagram) {
	diagram->removeComponent(this);
}

std::vector<Connector*>* Component::getAttributeConnectors() {
	return &conectoresEntrantes;
}

std::vector<Connector*>* Component::getExitConnectors() {
	return &conectoresSalientes;
}

std::string Component::getName() const {
	return nombre;
}

void Component::setX(unsigned x){
	m_posX = x;
}

void Component::setY(unsigned y){
	m_posY = y;
}

unsigned Component::getX() const {
	return m_posX;
}

unsigned Component::getY() const {
	return m_posY;
}

void Component::setName(const std::string & name) {
	nombre = name;
}
